package com.gzsxy.esjy.sign.controller;

import com.gzsxy.esjy.sign.dto.ScreenSignProtocolDtoDto;
import com.gzsxy.esjy.sign.service.GSSignBusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * http回调
 * @author chenguoyi
 * @since 2020/9/7
 */
@RestController("sdkSign")
@RequestMapping("/sign")
public class SignController {

    @Autowired
    private GSSignBusinessService gSSignBusinessService;

    /**
     * 处理投屏板http回调
     */
    @PostMapping("/signOk")
    public Object signOk(@RequestBody ScreenSignProtocolDtoDto screenSignProtocolDto) {
        gSSignBusinessService.signOk(screenSignProtocolDto);
        return null;
    }

    @PostMapping(value = "/uploadPdf/{uuid}")
    public Object uploadPdf(HttpServletRequest request, @PathVariable("uuid") String uuid) throws IOException {
        gSSignBusinessService.uploadPdf(uuid, request);
        return null;
    }
}
